import { _decorator, Component, Node, UITransform } from 'cc';
import { map } from './map';
import { move } from './move';
const { ccclass, property } = _decorator;

@ccclass('camera')
export class camera extends Component {
	@property(map)
	weizhi:map=null
    @property(move)
	weizhi2:move=null
    start() {
    }

    update(deltaTime: number) {
		let newp = this.node.getParent().getComponent(UITransform).convertToWorldSpaceAR(this.weizhi.update(deltaTime))
        let newp2 = this.node.getParent().getComponent(UITransform).convertToWorldSpaceAR(this.weizhi2.update(deltaTime))
        this.node.setPosition(newp2.x,newp2.y)
        // console.log(newp,'99')

    }
}

